package com.xoa.dev.keyYouth.controller;


import com.xoa.dev.keyYouth.model.PAids;
import com.xoa.dev.keyYouth.service.PAidsService;
import com.xoa.util.ToJson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

@Controller
@RequestMapping("/PAids")
public class PAidsController {

    @Autowired
    private PAidsService pAidsService;

    @RequestMapping("/index")
    public String jsp(){
        return "app/pz/pzPAids/pzPAidsManager";
    }


    //添加
    @RequestMapping("/addPAids")
    @ResponseBody
    public ToJson addPAids(HttpServletRequest request, PAids record){
        return pAidsService.addPAids(request,record);
    }
    //查询 分页
    @RequestMapping("/selectPAids")
    @ResponseBody
    public ToJson selectPAids(Integer page, Integer pageSize, Boolean useFlag, PAids record
    ){
        return pAidsService.selectPAids(page,pageSize,useFlag,record);
    }
    //编辑
    @RequestMapping("/updatePAids")
    @ResponseBody
    public ToJson updatePAids(HttpServletRequest request,PAids record){
        return pAidsService.updatePAids(request,record);
    }
    //详情
    @RequestMapping("/selectPAidsInfo")
    @ResponseBody
    public ToJson selectPAidsInfo(Integer id){
        return pAidsService.selectInofPAids(id);
    }
    //删除
    @RequestMapping("/deletePAids")
    @ResponseBody
    public ToJson deletePAids(HttpServletRequest request,Integer id){
        return pAidsService.deletePAids(request,id);
    }

}
